package com.cug.nageoffer.user.controller;

import com.cug.nageoffer.model.entity.Interview;
import com.cug.nageoffer.model.vo.Result;
import com.cug.nageoffer.user.service.InterviewService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@Tag(name = "用户面试相关")
@RestController
@RequestMapping("/api/seeker/user/Interview")
public class InterviewController {

    @Resource
    private InterviewService interviewService;

    /**
     * 用户预约面试
     */
    @Operation(summary = "用户预约面试")
    @PostMapping("/reserve")
    public Result<String> reserve(@RequestBody Interview requestParam){
        return interviewService.reserve(requestParam);
    }

    /**
     * 用户预约面试
     */
    @Operation(summary = "查询用户面试状态计数")
    @PostMapping("/count")
    public Result<List<Integer>> count(@RequestParam Long id){
        return interviewService.count(id);
    }

    /**
     * 用户取消面试
     */
    @Operation(summary = "用户取消面试")
    @PostMapping("/cancel")
    public Result<String> cancel(@RequestBody Interview requestParam){
        return interviewService.cancel(requestParam);
    }

    /**
     * 用户修改面试时间
     */
    @Operation(summary = "用户修改面试时间")
    @PostMapping("/alter")
    public Result<String> alter(@RequestBody Interview requestParam){
        return interviewService.alter(requestParam);
    }

    /**
     * 用户完成面试
     */
    @Operation(summary = "用户完成面试")
    @PostMapping("/finish")
    public Result<String> finish(@RequestBody Interview requestParam){
        return interviewService.finish(requestParam);
    }
}
